<template>
  <div>
    <h1>{{ count }}{{ type123 }}</h1>
    <button @click="add">+</button>
  </div>
</template>
<script>
// @ is an alias to /src
import { mapState, mapGetters } from 'vuex'
export default {
  name: 'XXX',
  data() {
    return {

    }
  },
  methods: {
    add() {
      // dispatch 的返回结果是一个promise实例
      let res = this.$store.dispatch('changeCountAsync')
      res.then(data => {
        console.log(data)
      })
    }

  },
  computed: {
    ...mapGetters(['type123']),
    ...mapState(['count'])
  }
}
</script>
<style lang="less">
</style>